<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>添加课程</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
    <style>
        :root {
            --primary-color: #2c5545;
            --primary-light: #3a7d62;
            --primary-hover: #1e4636;
            --accent-color: #8ba888;
            --white: #fff;
            --shadow: 0 4px 24px rgba(44, 85, 69, 0.08);
            --radius: 12px;
            --transition: all 0.3s ease;
        }
        body {
            background: #f5f7f6;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            color: #222;
            margin: 0;
            padding: 0;
        }
        .container {
            max-width: 500px;
            margin: 40px auto 0 auto;
            padding: 32px 28px 24px 28px;
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
        }
        h1 {
            color: var(--primary-color);
            margin-bottom: 2rem;
            font-size: 1.7rem;
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        form {
            display: flex;
            flex-direction: column;
            gap: 1.2rem;
        }
        label {
            font-weight: 500;
            color: var(--primary-color);
            margin-bottom: 0.3rem;
        }
        input[type="text"], input[type="number"] {
            padding: 0.7rem 1rem;
            border: 1px solid #d1d9d6;
            border-radius: 6px;
            font-size: 1rem;
            background: #f5f7f6;
            transition: var(--transition);
        }
        input:focus {
            border-color: var(--primary-color);
            outline: none;
            background: var(--white);
        }
        .form-actions {
            display: flex;
            gap: 1rem;
            margin-top: 1rem;
        }
        button, .back-link {
            padding: 0.7rem 1.5rem;
            background: var(--primary-color);
            color: var(--white);
            border: none;
            border-radius: 6px;
            font-size: 1rem;
            cursor: pointer;
            text-decoration: none;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }
        button:hover, .back-link:hover {
            background: var(--primary-hover);
        }
        .back-link {
            background: var(--accent-color);
        }
        .back-link:hover {
            background: #6e8b6e;
        }
        @media (max-width: 600px) {
            .container { padding: 12px; }
            h1 { font-size: 1.2rem; }
        }
    </style>
</head>
<body>
<div class="container">
    <h1><i class="fas fa-plus"></i> 添加课程</h1>
    <form th:action="@{/course/add}" method="post" enctype="multipart/form-data">
        <div>
            <label for="name">课程名称：</label>
            <input type="text" id="name" name="name" required>
        </div>
        <div>
            <label for="coverFile">课程封面：</label>
            <input type="file" id="coverFile" name="coverFile" accept="image/*">
        </div>
        <div>
            <label for="introduction">课程简介：</label>
            <input type="text" id="introduction" name="introduction">
        </div>
        <div>
            <label for="sortOrder">课程排序：</label>
            <input type="number" id="sortOrder" name="sortOrder" value="0">
        </div>
        <div>
            <label for="videoFile">课程视频：</label>
            <input type="file" id="videoFile" name="videoFile" accept="video/*">
        </div>
        <div>
            <label for="author">作者：</label>
            <input type="text" id="author" name="author">
        </div>
        <div class="form-actions">
            <button type="submit"><i class="fas fa-save"></i> 提交</button>
            <a th:href="@{/course/list}" class="back-link"><i class="fas fa-arrow-left"></i> 返回</a>
        </div>
    </form>
</div>
</body>
</html> 